arg_c=$#
lipo_dir="`pwd`/lipo_ffmpeg/"
if [[ ! -d $lipo_dir ]]; then
	mkdir  $lipo_dir
fi
for argv in $*;
do
	dir="`pwd`/thin/$argv"
	if [[ -d "$dir" ]]; then
		lib_dir="$dir/lib/*.a"
		#echo $lib_dir
		for file in $lib_dir; do
			filename=${file##*/}
			echo "mergin $filename...."
			lipo_cmd="lipo -create "
			#lipo
			for argv_in in $*;
			do
				libfile="`pwd`/thin/$argv_in/lib/$filename"
				if [[ -f "$libfile" ]]; then
					lipo_cmd="$lipo_cmd $libfile"
				fi
			done
			#lipo 
			lipo_cmd="$lipo_cmd -output `pwd`/lipo/$filename"
		
			`$lipo_cmd`
		done
		break
	fi
done